import 'package:flutter/material.dart';
import 'package:part_time_job_pro/common/utils/common.dart';

import 'color.dart';

class AppTheme {
  static const horizontalMargin = 16.0;
  static const radius = 10.0;

  static ThemeData light = ThemeData(
    brightness: Brightness.light,
    scaffoldBackgroundColor: AppColor.scaffoldBackground,
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    primaryColor: AppColor.accentColor,
    colorScheme: ColorScheme.fromSwatch().copyWith(
      secondary: AppColor.accentColor,
    ),
    appBarTheme: const AppBarTheme(
      elevation: 0,
      centerTitle: true,
      backgroundColor: Colors.white,
      iconTheme: IconThemeData(
        color: AppColor.primaryText,
      ),
      titleTextStyle: TextStyle(
        color: AppColor.primaryText,
        fontSize: 20,
        fontWeight: FontWeight.w500,
      ),
      toolbarTextStyle: TextStyle(
        color: AppColor.primaryText,
        fontSize: 20,
        fontWeight: FontWeight.w500,
      ),
    ),
    bottomNavigationBarTheme: const BottomNavigationBarThemeData(
      backgroundColor: AppColor.scaffoldBackground,
      unselectedLabelStyle: TextStyle(fontSize: 12),
      selectedLabelStyle: TextStyle(fontSize: 12),
      unselectedItemColor: Color(0xffA2A5B9),
      selectedItemColor: AppColor.accentColor,
    ),
    // tabBarTheme: const TabBarTheme(
    //   indicatorSize: TabBarIndicatorSize.label,
    //   indicatorSize: TabBarIndicatorSize.label,
    //   labelColor: AppColor.accentColor,
    //   unselectedLabelColor: AppColor.secondaryText,
    // ),
  );

  ///默认下的主题
  static final ThemeData lightTheme = ThemeData(
    primarySwatch: CommonUtil.createMaterialColor(AppColor.norMainThemeColors),
    highlightColor: AppColor.norWhite01Color,
    splashColor: Colors.transparent,
    focusColor: AppColor.norWhite01Color,
    hoverColor: AppColor.norWhite01Color,
    colorScheme: const ColorScheme.light(
      primary: AppColor.norMainThemeColors,
      background: AppColor.norWhite01Color,
      secondary: AppColor.norMainThemeColors,
    ),
    textTheme: const TextTheme(
      //设置Material的默认字体样式
      bodyMedium:
          TextStyle(color: Color.fromRGBO(136, 136, 136, 1), fontSize: 16.0),
    ),
    useMaterial3: false,
  );

  //暗黑模式
  static final ThemeData darkTheme = ThemeData(
    primarySwatch: CommonUtil.createMaterialColor(AppColor.norMainThemeColors),
    colorScheme: const ColorScheme.dark(
      primary: AppColor.norMainThemeColors,
      background: AppColor.norBlackColors,
      secondary: AppColor.norMainThemeColors,
    ),
    textTheme: const TextTheme(
      //设置Material的默认字体样式
      bodyMedium:
          TextStyle(color: Color.fromRGBO(136, 136, 136, 1), fontSize: 16),
    ),
    useMaterial3: false,
  );

  //登录样式
  static const TextStyle seledLoginType = TextStyle(
      color: AppColor.norBlackColors,
      fontSize: 20,
      fontWeight: FontWeight.bold);
  static const TextStyle normalLoginType = TextStyle(
      color: AppColor.norYellow04Colors,
      fontSize: 18,
      fontWeight: FontWeight.normal);

  //appbar标题
  static const TextStyle appBarStyle = TextStyle(
      fontSize: 20,
      fontWeight: FontWeight.w500,
      color: AppColor.norBlackColors);

  //Action 标题
  static const TextStyle actionTitleStyle = TextStyle(
      fontSize: 14,
      fontWeight: FontWeight.w500,
      color: AppColor.norYellow01Colors);

  //输入框标题
  static const TextStyle textTitleStyle = TextStyle(
      fontSize: 16,
      fontWeight: FontWeight.w600,
      color: AppColor.norBlackColors);

  //文字链接样式
  static const TextStyle textLinkStyle = TextStyle(
      fontSize: 14,
      fontWeight: FontWeight.w500,
      color: AppColor.norBlue01Colors);
}
